package com.xlkj.ms.tools.core.response;
import java.util.List;

/**
 * 分页查询返回类
 * <pre>
 * {@code
 * {
 *     "code":"***",
 *     "msg":"****",
 *     "count":***,
 *     "results":[{***},{***}]
 * }
 * }
 * </pre>
 * @author zhuqifeng
 * @date 2021/11/10 13:56
 * @package com.xlkj.ms.tools.core.response
 */
public abstract class AbstractPageResponse<E> extends AbstractListWrapper<E> {

    private static final long serialVersionUID = -4938800396776264315L;

    /** 分页总数 */
    protected long count;

    public AbstractPageResponse() {}

    public AbstractPageResponse(String code, String msg, List<E> results) {
        this.code = code;
        this.msg = msg;
        this.results = results;
    }

    public AbstractPageResponse(String code, String msg){
        this.code = code;
        this.msg = msg;
    }

    public AbstractPageResponse(List<E> results, long count) {
        this.results = results;
        this.count = count;
    }

    public long getCount() {
        return count;
    }

    public void setCount(long count) {
        this.count = count;
    }
}